for a in range(1, 1000):
    for b in range(1, a):
        c = 1000 - a - b
        if a**2 + b**2 == c**2:
            print a, b, c, a * b * c
            exit
            
            
#alternative
print [(a, b, 1000 - a - b) for a in range(1, 1000) for b in range(1, a) if a**2 + b**2 == (1000 - a - b)**2]